package m2.attachement;


import m2.Element;

import m2.port.PortConfigRequis;
import m2.role.RoleFourni;

public class AttachementRFPR extends Element{

	protected PortConfigRequis portRequis;
	protected RoleFourni roleFournis;

	public AttachementRFPR(String name, PortConfigRequis portRequis, RoleFourni roleFournis) {
		super(name);
		this.portRequis = portRequis;
		this.roleFournis = roleFournis;
		this.roleFournis.addObserver(this);
		this.addObserver(portRequis);
	}

	public PortConfigRequis getPortRequis() {
		return portRequis;
	}

	public void setPortRequis(PortConfigRequis portRequis) {
		this.deleteObserver(this.portRequis);
		this.portRequis = portRequis;
		this.addObserver(this.portRequis);
	}

	public RoleFourni getRoleFournis() {
		return roleFournis;
	}

	public void setRoleFournis(RoleFourni roleFournis) {
		this.roleFournis.deleteObserver(this);
		this.roleFournis = roleFournis;
		this.roleFournis.addObserver(this);
	}


	@Override
	public void update(Object o, Object arg) {
		System.out.println("\n\n"+name+ " "+ arg+"\n");
		notifyObservers(arg);
	}
}
